
#import "GalleryRoom.h"

@implementation GalleryRoom

+(GalleryRoom *)instanceFromDictionary:(NSDictionary *)aDictionary {
    GalleryRoom *instance = [[GalleryRoom alloc] init];
    
    instance.name = aDictionary[@"name"];
    instance.documentName = aDictionary[@"document"];
    instance.imageNameFormat = aDictionary[@"image_name_format"];
              
    NSArray *jsonLamps = aDictionary[@"lamps"];
    NSMutableArray *lamps = [NSMutableArray arrayWithCapacity:jsonLamps.count];
    for (NSDictionary *jsonLamp in jsonLamps) {
        [lamps addObject:[GalleryRoomLamp instanceFromDictionary:jsonLamp]];
    }
    instance.lamps = lamps;
    
    return instance;
}

@end
